import QRCode from 'qrcode'
const downloadQR = async (row) => {
  try {
    const url = await QRCode.toDataURL(row.code, {
      width: 200,
      margin: 1,
      color: {
        dark: '#000000',
        light: '#ffffff'
      }
    });
    
    const link = document.createElement('a');
    link.download = `二维码_${row.code}_${row.name}.png`;
    link.href = url;
    document.body.appendChild(link);
    link.click();
    document.body.removeChild(link);
    
    ElMessage.success('二维码下载成功');
  } catch (error) {
    console.error('下载二维码失败:', error);
    ElMessage.error('下载二维码失败');
  }
};